/*
 * @(#)SysconfigInfo.java   1.0  2021年12月24日
 * 
 * Copyright (c)	2014-2020. All Rights Reserved.	GuangZhou hhmk Technology Company LTD.
 */
package com.swift.dts.service;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.swift.core.auth.Login;
import com.swift.core.model.ServiceRequest;
import com.swift.core.model.data.DataModel;
import com.swift.core.service.SynInterface;
import com.swift.dts.loadconfig.FileSysConfig;
import com.swift.dts.loadconfig.model.SysConfig;
import com.swift.dts.util.MailUtil.MainSendUser;

/**
 * 添加说明 
 * @author zhengjiajin
 * @version 1.0 2021年12月24日
 */
@Service("sysconfigInfo")
@Login
public class SysconfigInfo implements SynInterface {

    @Autowired
    private FileSysConfig fileSysConfig;

    /** 
     * @see com.swift.core.service.SynInterface#doService(com.swift.core.model.ServiceRequest)
     */
    @Override
    public DataModel doService(ServiceRequest req) {
        SysConfig sysConfig = fileSysConfig.read();
        if(sysConfig.getMainSendUser()==null) sysConfig.setMainSendUser(new MainSendUser());
        return sysConfig;
    }
}
